package com.xjzd.redis.lock;

import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

@Component
public class RedisLockClient {

    private final StringRedisTemplate stringRedisTemplate;

    public RedisLockClient(StringRedisTemplate stringRedisTemplate) {
        this.stringRedisTemplate = stringRedisTemplate;
    }

    public Lock getLock(String lockKey) {
        return new DistributedLock(lockKey, stringRedisTemplate);
    }
}
